home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / EnterAct 3.5 / Read Resource Manual < prev   
Encoding:
Text File  |  1992-06-07  |  5.1 KB  |  171 lines  |  [TEXT/KEEN]

  1. Read Resource manual
  2. Copyright © 1991 Dynabyte. You can redistribute or modify
  3. this file under the terms of the GNU General Public License as published by
  4. the Free Software Foundation (see the file “COPYING hAWK”).
  5.  
  6. This is an illustrated TEXT document. If you're not using EnterAct to view this,
  7. you won't see the pictures - but you'll still get the idea. Major topics are marked
  8. with MPW-compatible marks, typically accessed by holding down the
  9. <Option> or <Command> key and clicking in the title bar of this window.
  10.  
  11. EnterAct is named as the calling application below, but the operation is the same
  12. for any calling application—only the name of the menu that you pick
  13. Read Resource from will differ.
  14.  
  15. Contents
  16. --------
  17. Overview
  18. Installation
  19. Using Read Resource
  20.  
  21. ---------
  22.     Overview
  23. ---------
  24. Read Resource is packaged as a ResEdit resource file, and you'll find it in the "Drag_on
  25. Modules" folder after decompressing the “Drag_on Modules.sea” file on disk 2. There's
  26. a file called “Installing EnterAct” on disk 1 that explains how to decompress and install
  27. everything. The decompressed folder looks like this:
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. Read Resource is not a stand-alone application, but is rather a CODE resource which
  41. can be called from a full-fledged application. EnterAct is such an application, and
  42. complete instructions are included for calling Read Resource or any other Drag_on
  43. Module from your application if the notion intrigues you. See the “hAWK User’s
  44. Manual” towards the end, “Calling hAWK from your application”. The instructions
  45. there detail how to call any Drag_on Module from your application.
  46.  
  47. Drag_on Modules are rather like MPW tools, or HyperCard XCMD's, in that they focus
  48. on doing one specifc task, and rely on a calling application to do some of the routine work.
  49. Communication between the calling application and the module is primarily through
  50. TEXT files, a simpler version of the standard input/output concept in shells such as
  51. MPW and in the standard C libraries.
  52.  
  53. Read Resource will read a resource or the entire data fork from any (closed) file,
  54. format the results in a general way, and write the results to the file "$tempStdOut". If
  55. Read Resource is called through EnterAct, you will be shown "$tempStdOut".
  56.  
  57. Read Resource is mainly useful for displaying and verifying the contents of a resource
  58. or data fork that your own application has created. Although the raw result from Read
  59. Resource is useful in itself, you can with just a bit of work write a little hAWK
  60. program to take the results from Read Resource and format the results to your liking,
  61. as well as verifying the contents of the resource or data fork. The tough part has been
  62. done for you, in the sample hAWK program "$Print_MENU_Resource", which
  63. contains the functions you’ll need to format and display your own custom resources.
  64.  
  65. ----------
  66.     Installation
  67. ----------
  68. Well, if you’re reading this then you’ve already installed Read Resource, and
  69. the results should look something like this:
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. Details: Read Resource must be in a folder called "Drag_on Modules", and this folder must
  82. be in the same folder as THINK C and EnterAct, at the same level, in order for EnterAct to
  83. detect it. Nothing else needs to be anywhere. This policy is recommended for any other
  84. application that wishes to call Drag_on Modules. 
  85.  
  86. To verify that EnterAct has picked up the presence of your Drag_on Modules, start up
  87. EnterAct: you should see your installed Modules listed at the bottom of the "EnterAct"
  88. menu. 
  89.  
  90. ----------------
  91.     Using Read Resource
  92. ----------------
  93. Before calling Read Resource, you should know the resource type and id number that you
  94. want to view. 
  95.  
  96. Select "Read Resource" from the "EnterAct" menu within EnterAct. You will be shown
  97. a standard Open dialog asking you to pick the file from which to take the resource or
  98. data fork. 
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118. Next, you'll see a dialog asking you to type in the resource type and id. To
  119. specify the data fork, enter a type of "data", and an id of "0"(zero). 
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. After clicking OK, the contents of the resource or data fork will be formatted and saved
  137. to the file "$tempStdOut". Note the "temp" in this file name is to remind you that the
  138. contents of this file are routinely overwritten by Drag_on Modules, so if you want a
  139. permanent version of the results you should use "Save As..." to save the file under a
  140. different name. EnterAct will display the contents of "$tempStdOut" at the end.
  141.  
  142. What you get looks something like this: (a MENU resource)
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163. The format is: starting byte number (zero-based); followed by four groups of 4-byte
  164. chunks of data displayed as hex numbers, two hex digits per byte; followed by a rough
  165. ASCII version of the data, with a period taking the place of any characters that don't
  166. seem to be ASCII. The same format is used for display of a data fork. The last line of the
  167. listing will be padded out with zeroes to make up a full four groups of hex numbers, but
  168. the ASCII equivalent will not be padded.
  169.  
  170. The only significant restriction on Read Resource is that it will refuse to do anything with
  171. an open file. This includes the system, and the calling application, and Read Resource itself.